package com.ymttest.database.sqlwapper.anlihui;

import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.anlihui.SettlementDetail;
import com.ymttest.database.model.anlihui.YmtAnlihuiProduct;

public class YmtAnlihuiProductWrapper {
	SqlManager manager;

    public YmtAnlihuiProductWrapper() {
        manager = new SqlManager("intpro");
    }
    
    @SuppressWarnings("unchecked")
	public YmtAnlihuiProduct selectByPrimaryKey(Integer id) {
    	
    	YmtAnlihuiProduct ymtAnlihuiProduct = new YmtAnlihuiProduct();
    	List<YmtAnlihuiProduct> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.anlihui.YmtAnlihuiProductMapper.selectByPrimaryKey",
                        id);
        manager.commit();
        
		if (result.size() > 0) {
			ymtAnlihuiProduct = result.get(0);
		}
		
        return ymtAnlihuiProduct;
    }
    
    
  public YmtAnlihuiProduct selectByProductId(String productId) {
    	
    	YmtAnlihuiProduct ymtAnlihuiProduct = new YmtAnlihuiProduct();
    	List<YmtAnlihuiProduct> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.anlihui.YmtAnlihuiProductMapper.selectByProductId",
                        productId);
        manager.commit();
        
		if (result.size() > 0) {
			ymtAnlihuiProduct = result.get(0);
		}
		
        return ymtAnlihuiProduct;
    }
    public static void main(String[] args) {
    	
    	YmtAnlihuiProductWrapper test = new YmtAnlihuiProductWrapper();
    	System.out.println(test.selectByPrimaryKey(10).getProductId());
    }
}
